/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package svp;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author kandamaran
 */
@Entity
@Table(name = "product_unit_tbl")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProductUnitTbl.findAll", query = "SELECT p FROM ProductUnitTbl p"),
    @NamedQuery(name = "ProductUnitTbl.findByIproductunitID", query = "SELECT p FROM ProductUnitTbl p WHERE p.iproductunitID = :iproductunitID"),
    @NamedQuery(name = "ProductUnitTbl.findByProductUnit", query = "SELECT p FROM ProductUnitTbl p WHERE p.productUnit = :productUnit"),
    @NamedQuery(name = "ProductUnitTbl.findByProductunitName", query = "SELECT p FROM ProductUnitTbl p WHERE p.productunitName = :productunitName"),
    @NamedQuery(name = "ProductUnitTbl.findByProductMrp", query = "SELECT p FROM ProductUnitTbl p WHERE p.productMrp = :productMrp"),
    @NamedQuery(name = "ProductUnitTbl.findByProductQty", query = "SELECT p FROM ProductUnitTbl p WHERE p.productQty = :productQty")})
public class ProductUnitTbl implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "iproduct_unitID")
    private Integer iproductunitID;
    @Basic(optional = false)
    @Column(name = "product_unit")
    private String productUnit;
    @Basic(optional = false)
    @Column(name = "product_unitName")
    private String productunitName;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "product_mrp")
    private Float productMrp;
    @Column(name = "product_qty")
    private Float productQty;
    @JoinColumn(name = "product_color", referencedColumnName = "product_color")
    @ManyToOne(optional = false)
    private ProductColorTbl productColor;
    @JoinColumn(name = "product_code", referencedColumnName = "product_code")
    @ManyToOne(optional = false)
    private ProductTbl productCode;

    public ProductUnitTbl() {
    }

    public ProductUnitTbl(Integer iproductunitID) {
        this.iproductunitID = iproductunitID;
    }

    public ProductUnitTbl(Integer iproductunitID, String productUnit, String productunitName) {
        this.iproductunitID = iproductunitID;
        this.productUnit = productUnit;
        this.productunitName = productunitName;
    }

    public Integer getIproductunitID() {
        return iproductunitID;
    }

    public void setIproductunitID(Integer iproductunitID) {
        this.iproductunitID = iproductunitID;
    }

    public String getProductUnit() {
        return productUnit;
    }

    public void setProductUnit(String productUnit) {
        this.productUnit = productUnit;
    }

    public String getProductunitName() {
        return productunitName;
    }

    public void setProductunitName(String productunitName) {
        this.productunitName = productunitName;
    }

    public Float getProductMrp() {
        return productMrp;
    }

    public void setProductMrp(Float productMrp) {
        this.productMrp = productMrp;
    }

    public Float getProductQty() {
        return productQty;
    }

    public void setProductQty(Float productQty) {
        this.productQty = productQty;
    }

    public ProductColorTbl getProductColor() {
        return productColor;
    }

    public void setProductColor(ProductColorTbl productColor) {
        this.productColor = productColor;
    }

    public ProductTbl getProductCode() {
        return productCode;
    }

    public void setProductCode(ProductTbl productCode) {
        this.productCode = productCode;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iproductunitID != null ? iproductunitID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProductUnitTbl)) {
            return false;
        }
        ProductUnitTbl other = (ProductUnitTbl) object;
        if ((this.iproductunitID == null && other.iproductunitID != null) || (this.iproductunitID != null && !this.iproductunitID.equals(other.iproductunitID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "svp.ProductUnitTbl[ iproductunitID=" + iproductunitID + " ]";
    }
    
}
